package com.ctjsoft.fileupload.mapper;

import com.ctjsoft.fileupload.entity.TMinioServer;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TMinioServerMapper {

    @Select("select * from t_minio_server")
    List<TMinioServer> getMinioServerList();

    @Insert("insert into t_minio_server(id,host,port,access_key,secret_key,server_name) values(#{id},#{host},#{port},#{accessKey},#{secretKey},#{serverName})")
    int addMinioServer(TMinioServer tMinioServer);

    @Update("<script>update t_minio_server set host=#{host},port=#{port},access_key=#{accessKey},secret_key=#{secretKey},server_name=#{serverName} where id=#{id}</script>")
    int updateMinioServer(TMinioServer tMinioServer);

    @Delete("delete t_minio_server where id=#{id}")
    int deleteMinioServer(String id);

    @Select("select * from t_minio_server where id=#{id}")
    TMinioServer getMinioServerById(String id);

    @Select("select * from t_minio_server where server_name=#{serverName}")
    TMinioServer getMinioServerByName(String serverName);
}
